﻿using LdtJudge.DataEngine.CallInterface.CommHelp;
using LdtJudge.DataEngine.Model.DataModel.DataParseStorage;
using System;
using System.Collections.Generic;
using System.Text;

namespace LdtJudge.DataEngine.Data.DataParseStorage
{
    /// <summary>
    /// 发言人段落信息
    /// </summary>
    public class DAL_An_fayanrenduanluoxinxi
    {
        private IFreeSql FreeSql = FreeSQLHelp.GetFreeSQL("Ldt_DataParseStorage");
        /// <summary>
        /// 获取发言人段落信息列表
        /// </summary>
        /// <param name="anjid">条件</param>
        /// <returns></returns>
        public List<An_fayanrenduanluoxinxi> GetList(string jueseid)
        {
            return FreeSql.Select<An_fayanrenduanluoxinxi>().Where(a => a.Jueseid == jueseid).ToList();
        }

        /// <summary>
        /// 添加发言人段落信息
        /// </summary>
        /// <param name="model">发言人段落信息</param>
        /// <returns></returns>
        public int Insert(An_fayanrenduanluoxinxi model)
        {
            return FreeSql.Insert<An_fayanrenduanluoxinxi>(model).ExecuteAffrows();
        }

        /// <summary>
        /// 更新发言人段落信息
        /// </summary>
        /// <param name="model">发言人段落信息</param>
        /// <returns></returns>
        public int Update(An_fayanrenduanluoxinxi model)
        {
            return FreeSql.Update<An_fayanrenduanluoxinxi>(model).SetSourceIgnore(model, col => col == null).ExecuteAffrows();
        }
    }
}
